<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>添加module</title>
    <link href="${pageContext.request.contextPath}/style/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/tool/jquery/jquery.min.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/js/public.js"></script>
</head>
<body>
 <div class="mainCon">
  <div class="mCon">
  <div class="mCon_tab">
   <ul>   
    <li><span class="mCon_1cuta">添加 / 修改一个模块</span></li>

   </ul>
  </div>
  <form action="${pageContext.request.contextPath}/admin/securityModule/do_save.action" method="post" onsubmit="return beforeSubmit();">
  <input type="hidden" name="id" value="${empty baseinfo ? 0 : baseinfo.id}" />
  <input type="hidden" name="moduletype" value="${empty baseinfo ? 2 : baseinfo.moduletype}" />
  <div class="main_list">
   <div class="inke_list">
    <div class="mCon_1t mCon_2t"><strong>模块名称：</strong></div>

    <div class="mCon_con mCon_con2"><input type="text" name="modulename" value="${baseinfo.modulename}" style="width:40%;height:23px;" onfocus="this.className='int_yewBg'" onblur="this.className=''" /></div>
   </div>
   <div class="inke_list">
    <div class="mCon_1t mCon_2t"><strong>模块描述：</strong></div>
    <div class="mCon_con mCon_con2"><input type="text" name="moduledesc" value="${baseinfo.moduledesc}" style="width:40%;height:23px;" onfocus="this.className='int_yewBg'" onblur="this.className=''" /></div>
   </div>
   <div class="inke_list">
	<input type="hidden" name="urlids" id="urlids" value="${baseinfo.urlids}" />
    <div class="mCon_1t mCon_2t"><strong>包含功能点：</strong></div>
    <div class="mCon_con mCon_con2" id="checkbox_urls">
    <c:if test="${!empty cbUrls}">
    <c:forEach items="${cbUrls}" var="cbUrl">
    	<input type="checkbox" name="urls" value="${cbUrl['cbValue']}" chk="${cbUrl['checked']}" />${cbUrl['cbShow']}
    </c:forEach>
    </c:if>
    
    </div>
    </div>

  </div>
  <div class="scxz">

      <input class="fx1" name="" type="submit" value="保 存" />
      <input class="fx1" type="button" onclick="history.back(-1);" value="返 回" />
  </div>
  </form>
  <div class="clear"></div>
  </div>
  <div class="clear"></div>
 </div>
 <script type="text/javascript">
 $(function(){
	//选中已选checkbox
	$("#checkbox_urls input[name='urls']").each(function(){
 		if ($(this).attr("chk")=="true") {
	 		$(this).attr("checked","checked");
	 	}
 	})
 });
 var beforeSubmit = function(){
 	var checkedurls = "";
 	$("#checkbox_urls input[name='urls']").each(function(){
 		if ($(this).attr("checked")) {
 			if(checkedurls!="")checkedurls = checkedurls + ",";
 			checkedurls = checkedurls + $(this).val();
 		}
 	})
 	if(checkedurls == ""){
 		alert("请选择至少一个功能点");
 		return false;	
 	}
 	$("#urlids").val(checkedurls);
 	return true;
 }
 </script>
</body>
</html>


